#!/bin/sh

# 30 different experimental set (for maturity=0.25) are tested, each one with 1000 runs of the simulator. 
#Five different stock market volatility setting are used (0.1, 0.2, 0.3, 0.4, 0.5). 
#Six different stock market drift setting are used (-0.5, -0.3, -0.1, 0.1, 0.3, 0.5). 
#After the completion of one execution, descriptive statistics on  the pricing bias are presented in the console.

REPASTPATH="./repast.simphony.runtime_2.0.1/bin/*:./repast.simphony.runtime_2.0.1/bin/:./repast.simphony.runtime_2.0.1/lib/*:./repast.simphony.batch_2.0.1/bin:./repast.simphony.core_2.0.1/lib/*:./repast.simphony.bin_and_src_2.0.1/repast.simphony.bin_and_src.jar:./lib/*:./lib/commons-math-2.2.jar:./bin/"

PRINT_AVER="java -Xss10M -Xmx400M -cp $CLASSPATH:$REPASTPATH LAAMI.FileRead4"

#--Compilation--
javac -d ./bin -cp $CLASSPATH:$REPASTPATH src/LAAMI/*.java

#--Executions--
#echo;echo -- Descriptive Statistics of Pricing Bias and Profit for Maturity=0.25 --; echo

for volatility in 0.1 0.2 0.3 0.4 0.5
do
  for drift in -0.5 -0.3 -0.1 0.1 0.3 0.5
  do
    java -Xss10M -Xmx400M -cp $CLASSPATH:$REPASTPATH repast.simphony.batch.BatchMain -params batch/${volatility}_${drift}.xml -interactive ./LAAMI.rs
  done
done



$PRINT_AVER

#echo "-- Winner Statistics --"; $PRINT_PJW;
#echo "-- Loser Statistics --"; $PRINT_PJL;

#gnuplot -persist gnuplot/gp1.plt
#gnuplot -persist gnuplot/gp2.plt
#gnuplot -persist gnuplot/gp3.plt
#gnuplot -persist gnuplot/gp4.plt
#gnuplot -persist gnuplot/gp5.plt
#gnuplot -persist gnuplot/gp6.plt
gnuplot -persist gnuplot/gpAll.plt


